﻿
@{
    ViewBag.Title = "Content";
}
<link href="@Url.Content("~/css/aui-content.css")" rel="stylesheet" />
<link href="~/css/common.css" rel="stylesheet" />

<header class="aui-bar aui-bar-nav" id="aui-header">
    <a class="aui-btn aui-pull-left" href="javascript:" onclick="return tiaozhuan();"> <span class="aui-iconfont aui-icon-left"></span> </a>
    <div class="aui-title"><!--标题--></div>
</header>
<section class="aui-content">
    <div class="aui-card-list aui-border-t aui-border-b">
        <div class="aui-card-list-header pd">
            <!--标题+日期-->
        </div>
        <div class="aui-card-list-content">
            <img id="articleImg" class="pd" />
        </div>
        <div class="aui-card-list-content-padded" style="color:#7b7b7b;padding-bottom: 4em;">
            <!--内容-->
        </div>
    </div>
</section>

<!--加载动画Start-->
<div id="loading">
    <div class="loading">
        <img src="~/image/loading.gif" />
    </div>
</div>
<!--加载动画End-->

<script src="~/Scripts/commonJS.js"></script>

<script type="text/javascript">

    $(function () {
        var ID = getUrlParam('ID');
        //绑定内容页数据
        $.ajax({
            url: "http://shtdj.shanhaitian.gov.cn/AppInterface/api/Article/GetArticleModel",
            contentType: "application/json",
            type: "POST",
            async: true,
            data: JSON.stringify({ ID: ID }),
            success: function (data, status) {
                var dd = eval(data.result);
                //赋值
                $(".aui-title").html(dd.Title);
                $(".aui-card-list-header").html(dd.Title + '【' + dd.CreateTime.replace("T", " ") + '】');

                var img = "";
                if (dd.ImageUrl == null || dd.ImageUrl == "") {
                    img = 'http://shtdj.shanhaitian.gov.cn/' + "image/IMG_7895.jpg";//默认图片
                }
                else {
                    img = 'http://shtdj.shanhaitian.gov.cn/' + dd.ImageUrl;
                }

                $("#articleImg").prop("src", img);
                $(".aui-card-list-content-padded").html(dd.Content);

                //隐藏加载动画
                $("#loading").hide();
            },
            error: function (xhr, textStatus) {
                console.log('错误')
                console.log(xhr)
                console.log(textStatus)
            }
        });

    });

    var tiaozhuan = function () {
        var ID = getUrlParam('MenuId');
        var module = getUrlParam('module');
        window.location.href = "@Url.Action("Index")?ID=" + ID + "&module=" + module + "";
    }

</script>

